/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package iTraceMD.provider;


import iTraceMD.ElementTraceLink;
import iTraceMD.ITraceMDPackage;

import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

/**
 * This is the item provider adapter for a {@link iTraceMD.ElementTraceLink} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class ElementTraceLinkItemProvider
	extends ItemProviderAdapter
	implements
		IEditingDomainItemProvider,
		IStructuredItemContentProvider,
		ITreeItemContentProvider,
		IItemLabelProvider,
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ElementTraceLinkItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

			addNameModelTracePropertyDescriptor(object);
			addVersionPropertyDescriptor(object);
			addCreatedOnPropertyDescriptor(object);
			addModePropertyDescriptor(object);
			addCommentPropertyDescriptor(object);
			addTechnicalBindingPropertyDescriptor(object);
			addTypeLinkPropertyDescriptor(object);
			addRelationTypePropertyDescriptor(object);
			addModelNamePropertyDescriptor(object);
			addAbstractionLevelPropertyDescriptor(object);
			addMetamodelPropertyDescriptor(object);
			addAspectPropertyDescriptor(object);
			addRuleNamePropertyDescriptor(object);
			addCreatedByPropertyDescriptor(object);
			addTransformationTypePropertyDescriptor(object);
			addRefPropertyDescriptor(object);
			addTraceLinkPropertyDescriptor(object);
			addElementPropertyDescriptor(object);
		}
		return itemPropertyDescriptors;
	}

	/**
	 * This adds a property descriptor for the Name Model Trace feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addNameModelTracePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_nameModelTrace_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_nameModelTrace_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__NAME_MODEL_TRACE,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Version feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addVersionPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_version_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_version_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__VERSION,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Created On feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCreatedOnPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_createdOn_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_createdOn_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__CREATED_ON,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Mode feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addModePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_mode_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_mode_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__MODE,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Comment feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCommentPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_comment_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_comment_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__COMMENT,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Technical Binding feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addTechnicalBindingPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_technicalBinding_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_technicalBinding_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__TECHNICAL_BINDING,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Type Link feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addTypeLinkPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_typeLink_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_typeLink_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__TYPE_LINK,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Relation Type feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addRelationTypePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_relationType_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_relationType_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__RELATION_TYPE,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Model Name feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addModelNamePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_modelName_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_modelName_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__MODEL_NAME,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Abstraction Level feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addAbstractionLevelPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_abstractionLevel_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_abstractionLevel_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__ABSTRACTION_LEVEL,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Metamodel feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addMetamodelPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_metamodel_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_metamodel_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__METAMODEL,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Aspect feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addAspectPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_aspect_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_aspect_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__ASPECT,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Rule Name feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addRuleNamePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_ruleName_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_ruleName_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__RULE_NAME,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Created By feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCreatedByPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_createdBy_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_createdBy_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__CREATED_BY,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Transformation Type feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addTransformationTypePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_transformationType_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_transformationType_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__TRANSFORMATION_TYPE,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Ref feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addRefPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_ref_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_ref_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__REF,
				 true,
				 false,
				 true,
				 null,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Trace Link feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addTraceLinkPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_traceLink_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_traceLink_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__TRACE_LINK,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Element feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addElementPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_ElementTraceLink_element_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_ElementTraceLink_element_feature", "_UI_ElementTraceLink_type"),
				 ITraceMDPackage.Literals.ELEMENT_TRACE_LINK__ELEMENT,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This returns ElementTraceLink.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/ElementTraceLink"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		String label = ((ElementTraceLink)object).getModelName();
		return label == null || label.length() == 0 ?
			getString("_UI_ElementTraceLink_type") :
			getString("_UI_ElementTraceLink_type") + " " + label;
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);

		switch (notification.getFeatureID(ElementTraceLink.class)) {
			case ITraceMDPackage.ELEMENT_TRACE_LINK__NAME_MODEL_TRACE:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__VERSION:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__CREATED_ON:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__MODE:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__COMMENT:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__TECHNICAL_BINDING:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__TYPE_LINK:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__RELATION_TYPE:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__MODEL_NAME:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__ABSTRACTION_LEVEL:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__METAMODEL:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__ASPECT:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__RULE_NAME:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__CREATED_BY:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__TRANSFORMATION_TYPE:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__TRACE_LINK:
			case ITraceMDPackage.ELEMENT_TRACE_LINK__ELEMENT:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
				return;
		}
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);
	}

	/**
	 * Return the resource locator for this item provider's resources.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public ResourceLocator getResourceLocator() {
		return ITraceMDEditPlugin.INSTANCE;
	}

}
